home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Freeware / CharMap / Install < prev   
Encoding:
Text File  |  2002-03-13  |  9.8 KB  |  313 lines

  1. ; $VER:Installation script for CharMap
  2. ; Author: Adapted from Michael Link's script
  3. ; Begin       : 19/11/99
  4.  
  5. ; Let's begin with the installer script's messages:
  6. (set DIRHELP (cat "You must enter the name of the directory, in which\n"
  7.           @app-name " shall be installed.\n\n"
  8.           "If you want " @app-name " to be active everytime you\n"
  9.           "start the computer, enter the directory\n"
  10.           "\"SYS:WBStartup\", which is the default directory.\n"
  11.           "You can enter \"SYS:Tools/Commodities\", if you want to\n"
  12.           "use it just sometimes or start it from user-startup.\n"
  13.          )
  14. )
  15.  
  16. (set M_WELCOME    (cat    "Welcome to the installation of " @app-name " v1.6. This little\n"
  17.             "tool can display all the characters of a given font."
  18.     )
  19. )
  20.  
  21. (set CHARSET_HELP (cat    "The charset indicates how many characters will be displayed\n"
  22.             "at startup, among:\n"
  23.             "   · Default: The charset used is adjusted to the one the font uses\n"
  24.             "   · 8bits ASCII: All characters, from 0 to 255\n"
  25.             "   · ISO Latin1: The characters from 32 to 255 only\n"
  26.             "   · Amiga standard: Like ISO Latin1, without the chars from 127 to 159\n"
  27.             "\n\nActually, some fonts (XHelvetica, and so on...) define all\n"
  28.             "possible chars between 0 and 255, but only those definied in\n"
  29.             "the Amiga standard have a meaning graphical symbol. That's why\n"
  30.             "it could be interesting to force the charset to display at\n"
  31.             "startup."
  32.     )
  33. )
  34.  
  35. (set GEOMETRY_HELP (cat "This tool-type defined the position of the main and minimized\n"
  36.             "window. It represents a comma separated list of signed numbers.\n"
  37.             "The first two, correspond to the position of the main window, and\n"
  38.             "the next two, to the minimized one. If nothing is given, the\n"
  39.             "position will be centered on screen. Negative values can be\n"
  40.             "enterred, in such case, position is relative to the opposite\n"
  41.             "border is usually refers to."
  42.     )
  43. )
  44.  
  45. (set STARTUP_HELP  (cat    "You can launch this tool directly from the user-startup.\n"
  46.             "In such case, an entry like this this will be inserted:\n"
  47.             "; BEGIN " @app-name "\n"
  48.             "Run >NIL: " @app-name " CX_POPUP=NO ...\n"
  49.             "Parameters will be those you will enterred.\n"
  50.             "you can use a automatic launch by placing the programme\n"
  51.             "and it's icon in the WBStartup drawer of the boot disk, or\n"
  52.             "at last if you want to use it just sometimes, place it in\n"
  53.             "another drawer, like C: or SYS:Tools/Commodities."
  54.     )
  55. )
  56.  
  57. (set WHICH_STARTUP    "How do you want to start this commodity?")
  58.  
  59. (set WHICH_CHARSET    "Which charset would you like to display at start?")
  60.  
  61. (set WHICH_SORTING    "How do you want to sort the charset at start?")
  62.  
  63. (set WHICH_CLOSING    "What does the window's close gadget do?")
  64.  
  65. (set WHICH_GEOMETRY    "What will be the initial position of the windows?")
  66.  
  67. (set WHICH_CATALOG    "\nWhich language do you want to install ? (in LOCALE:)\n")
  68.  
  69. (set DIR_REQUEST (cat    "Please enter the destination directory for " @app-name ))
  70.  
  71. (set WHICH_HOTKEY (cat    "\n\nWith which key combination shall the\n"
  72.             "window be reopen when it is hiden ?"
  73.     )
  74. )
  75.  
  76. (set MSG_COPYLANG    "Copying catalog ")
  77.  
  78. ; Default values:
  79. (set DEF_DESTDIR    "SYS:WBStartup")
  80. (set DEF_HOTKEY        "ctrl lalt c")
  81. (set DEF_GEOMETRY    ",,,")
  82. (set DEF_CHARSET    "0")
  83. (set DEF_SORTING    1)
  84. (set DEF_CLOSING    0)
  85.  
  86. (set vernum (getversion "locale.library" (resident)))
  87. (set ver (shiftright vernum 16))
  88.  
  89. ;
  90. ; Here is the screen where the user's skill is controlled:
  91. ;
  92.  
  93. (welcome M_WELCOME)
  94.  
  95. ; ***********************************************************************
  96. ; *                                                                     *
  97. ; * Request for the destination file (usually user-startup)             *
  98. ; *                                                                     *
  99. ; ***********************************************************************
  100.  
  101. ; Only for expert!
  102. (if (< @user-level 2)
  103.     (set AUTO 0 DF_BITS 1)
  104. (    (set DF_BITS (askchoice (prompt WHICH_STARTUP)
  105.                 (help STARTUP_HELP)
  106.                 (choices "User-Startup"
  107.                      "WBStartup drawer"
  108.                      "Other directory")
  109.                 (default 0)
  110.              )
  111.     )
  112.     ; Place the prog. automatically in WBStartup drawer:
  113.     (set AUTO (= DF_BITS 1))
  114.     ; If the user want to launch it from user-startup, install tool in C:
  115.     (if (= DF_BITS 0) (set DEF_DESTDIR "C:"))
  116.     ; If the user doesn't whant to launch at every boot:
  117.     (if (= DF_BITS 2) (set DEF_DESTDIR "SYS:Tools/Commodities"))
  118. ))
  119.  
  120.  
  121. ; ***********************************************************************
  122. ; *                                                                     *
  123. ; * Request for the destination directory                               *
  124. ; *                                                                     *
  125. ; ***********************************************************************
  126.  
  127. ; For novice set directory to WBStartup:
  128. (if (= AUTO 0)
  129.     (if (= @user-level 0)
  130.         (set DIR DEF_DESTDIR)
  131.         (set DIR (askdir (prompt DIR_REQUEST)
  132.                  (help DIRHELP)
  133.                  (default DEF_DESTDIR)
  134.              )
  135.         )
  136.     )
  137.     (set DIR DEF_DESTDIR)
  138. )
  139.  
  140. (set @default-dest DIR)
  141.  
  142.  
  143. ; ***********************************************************************
  144. ; *                                                                     *
  145. ; * Asking for the tool-types                                           *
  146. ; *                                                                     *
  147. ; ***********************************************************************
  148.  
  149. ; * HOTKEY *
  150. (if (= @user-level 0)
  151.     (set HOTKEY DEF_HOTKEY)
  152.  
  153.     (set HOTKEY (askstring    (prompt WHICH_HOTKEY)
  154.                 (help @askstring-help)
  155.                 (default DEF_HOTKEY)
  156.             )
  157.     )
  158. )
  159.  
  160. ; * CHARSET *
  161. (if (= @user-level 0)
  162.     (set CHARSET DEF_CHARSET)
  163.  
  164. (    (set CS_BITS (askchoice (prompt WHICH_CHARSET)
  165.                 (help CHARSET_HELP)
  166.                 (choices "8bits ASCII    (256 characters)"
  167.                      "ISO Latin1     (224)"
  168.                      "Amiga Standard (192)"
  169.                      "Default        (Depends on the font used)")
  170.                 (default 3)
  171.              )
  172.     )
  173.     (if (= CS_BITS 0) (set CHARSET "1"))
  174.     (if (= CS_BITS 1) (set CHARSET "2"))
  175.     (if (= CS_BITS 2) (set CHARSET "3"))
  176.     (if (= CS_BITS 3) (set CHARSET "0"))
  177. ))
  178.  
  179. ; * SORTING METHOD *
  180. (if (AND (< @user-level 2) (= DF_BITS 0))
  181.     (set SORTING DEF_SORTING)
  182.     (set SORTING (askchoice (prompt WHICH_SORTING)
  183.                 (help @askchoice-help)
  184.                 (choices "Vertically" "Horizontally")
  185.                 (default DEF_SORTING)
  186.              )
  187.     )
  188. )
  189.  
  190. ; * CLOSE GADGET ACTION *
  191. (if (< @user-level 1)
  192.     (set CLOSING DEF_CLOSING)
  193.     (set CLOSING (askchoice (prompt WHICH_CLOSING)
  194.                 (help @askchoice-help)
  195.                 (choices "Hides the interface" "Quits the commodity")
  196.                 (default DEF_CLOSING)
  197.              )
  198.     )
  199. )
  200.  
  201. ; * GEOMETRY (only for expert!) *
  202. (if (< @user-level 2)
  203.     (set GEOMETRY DEF_GEOMETRY)
  204.     (set GEOMETRY (askstring (prompt WHICH_GEOMETRY)
  205.                  (help GEOMETRY_HELP)
  206.                  (default DEF_GEOMETRY)
  207.               )
  208.     )
  209. )
  210.  
  211. (tooltype (prompt "Writing tool-types ...")
  212.       (help)
  213.       (dest @app-name)
  214.       (settooltype "HOTKEY"   HOTKEY)
  215.       (settooltype "CHARSET"  CHARSET)
  216.       (settooltype "GEOMETRY" GEOMETRY)
  217.       ; VERTICALSORT & CLOSEQUIT can't be unset due to buggy
  218.       ; routines of Intaller tool...
  219.        ; (if (= CLOSING 0) (settooltype "CLOSEQUIT"))
  220.        ; (if (= SORTING 1) (settooltype "VERTICALSORT"))
  221. )
  222.  
  223.  
  224. (if (= DF_BITS 0)
  225. (    ; The user want to launch it via startup script
  226.     ; Don't copy icon and modify user-startup:
  227.     (copyfiles (prompt (cat "Copying from " @app-name " to " DIR))
  228.            (help @copyfiles-help)
  229.            (source @app-name)
  230.            (dest DIR)
  231.     )
  232.     ; Modify the startup script:
  233.     (set STR_COMMAND (cat "Run >NIL: " @app-name " CX_POPUP=NO CHARSET=" CHARSET " GEOMETRY=" GEOMETRY " HOTKEY=\"" HOTKEY "\""))
  234.     (if (= SORTING 1) (set STR_COMMAND (cat STR_COMMAND " HORIZONTALSORT")))
  235.     (if (= CLOSING 1) (set STR_COMMAND (cat STR_COMMAND " CLOSEQUIT")))
  236.     (set STR_COMMAND (cat STR_COMMAND "\n"))
  237.     (startup @app-name
  238.         (prompt (cat "Inserting command\n" STR_COMMAND "in S:User-Startup file"))
  239.         (help STARTUP_HELP)
  240.         (command STR_COMMAND)
  241.     )
  242. )
  243.     (copyfiles (prompt (cat "Copying from " @app-name " to " DIR))
  244.            (help @copyfiles-help)
  245.            (source @app-name)
  246.            (dest DIR)
  247.            (infos)
  248.     )
  249. )
  250.  
  251.  
  252. ; ***********************************************************************
  253. ; *                                                                     *
  254. ; * Installation of the catalogs                                        *
  255. ; *                                                                     *
  256. ; ***********************************************************************
  257.  
  258. (if (>= ver 38)
  259.     (
  260.         (set DEF_LANG 0)
  261.     (if (= @language "français") (set DEF_LANG 1))
  262.     (if (= @language "deutsch")  (set DEF_LANG 2))
  263.     (if (= @language "español")  (set DEF_LANG 4))
  264.     (if (= @language "polski")   (set DEF_LANG 8))
  265.     (if (= @language "magyar")   (set DEF_LANG 16))
  266.     (if (= @user-level 0)
  267.         (set CATALOGS DEF_LANG)
  268.         (set CATALOGS (askoptions (prompt WHICH_CATALOG)
  269.                       (help @askoptions-help)
  270.                       (choices "Français" "Deutsch" "Español" "Polski" "Magyar")
  271.                       (default DEF_LANG)
  272.                   )
  273.         )
  274.     )
  275.     (if (BITAND CATALOGS 1)
  276.         (copyfiles (prompt (cat MSG_COPYLANG "French..."))
  277.                    (help @copyfiles-help)
  278.                    (source "catalogs/français/CharMap.catalog")
  279.                    (dest   "LOCALE:Catalogs/français")
  280.         )
  281.     )
  282.     (if (BITAND CATALOGS 2)
  283.         (copyfiles (prompt (cat MSG_COPYLANG "German..."))
  284.                    (help @copyfiles-help)
  285.                    (source "catalogs/deutsch/CharMap.catalog")
  286.                    (dest   "LOCALE:Catalogs/deutsch")
  287.         )
  288.     )
  289.     (if (BITAND CATALOGS 4)
  290.         (copyfiles (prompt (cat MSG_COPYLANG "Spanish..."))
  291.                    (help @copyfiles-help)
  292.                    (source "catalogs/español/CharMap.catalog")
  293.                    (dest   "LOCALE:Catalogs/español")
  294.         )
  295.     )
  296.     (if (BITAND CATALOGS 8)
  297.         (copyfiles (prompt (cat MSG_COPYLANG "Polski..."))
  298.                    (help @copyfiles-help)
  299.                    (source "catalogs/polski/CharMap.catalog")
  300.                    (dest   "LOCALE:Catalogs/polski")
  301.         )
  302.     )
  303.     (if (BITAND CATALOGS 16)
  304.         (copyfiles (prompt (cat MSG_COPYLANG "Magyar..."))
  305.                    (help @copyfiles-help)
  306.                    (source "catalogs/magyar/CharMap.catalog")
  307.                    (dest   "LOCALE:Catalogs/magyar")
  308.         )
  309.     )
  310.     )
  311. )
  312.  
  313.